#!/usr/bin/perl

use strict;

use SQConfig;
use Getopt::Long;

exit if ( @ARGV < 1 );

my $sqconfig = SQConfig->new();

for my $file ( @ARGV ) {
    $sqconfig->reset();

    $sqconfig->read($file);

    for my $volume ( $sqconfig->get_volumelist() ) {
        my $nodeid = $volume->get_nodeid();
        my $node = $sqconfig->get_node($nodeid);
        my $nodename = $node->get_name();

        print "ssh $nodename lun-mount "
              . $volume->get_prim_loc() . '/' . $volume->get_name() . ','
              . $volume->get_mirr_loc() . '/' . $volume->get_name() . "\n"
              ;
    }
}
